import 'package:seedfour/generated/json/base/json_convert_content.dart';
import 'package:seedfour/app/models/file_info_entity.dart';

FileInfoEntity $FileInfoEntityFromJson(Map<String, dynamic> json) {
  final FileInfoEntity fileInfoEntity = FileInfoEntity();
  final String? tempPath = jsonConvert.convert<String>(json['tempPath']);
  if (tempPath != null) {
    fileInfoEntity.tempPath = tempPath;
  }
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    fileInfoEntity.name = name;
  }
  return fileInfoEntity;
}

Map<String, dynamic> $FileInfoEntityToJson(FileInfoEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['tempPath'] = entity.tempPath;
  data['name'] = entity.name;
  return data;
}

extension FileInfoEntityExtension on FileInfoEntity {
  FileInfoEntity copyWith({
    String? tempPath,
    String? name,
  }) {
    return FileInfoEntity()
      ..tempPath = tempPath ?? this.tempPath
      ..name = name ?? this.name;
  }
}